-
Notifications
You must be signed in to change notification settings - Fork 4
automatically copy locales #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR aims to automatically copy default locale files from the plugin resources to the locales folder during startup. Key changes include:
- Removal of the explicit creation of the locales directory in LocaleManager.
- Addition of code in Rocket.kt to copy the default locale "en_GB" to the locales folder.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/main/kotlin/dev/znci/rocket/i18n/LocaleManager.kt | Removed explicit directory creation for the locales folder, which may impact file listing if the folder does not exist. |
| src/main/kotlin/dev/znci/rocket/Rocket.kt | Introduced a default locales array and resource copy logic using saveResource. |
Comments suppressed due to low confidence (1)
src/main/kotlin/dev/znci/rocket/i18n/LocaleManager.kt:73
- Removing the explicit directory creation may lead to issues when listing files if the locales folder does not exist. Consider re-adding the mkdirs() call or ensuring the folder's existence elsewhere before listing files.
if (!langFolder.exists()) langFolder.mkdirs()
|
zNotChill
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Qodana Community for JVM42 new problems were found
☁️ View the detailed Qodana report Contact Qodana teamContact us at [email protected]
|
uses an array of default locale names, loops through them, and saves them to the directory using the
JavaPlugin#saveResourcemethod